package com.damon.service;

import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.damon.common.ResultModel;
import com.damon.exception.CustomPromptException;
import com.damon.jdbc.ExecutorProcedureJdbc;
import com.damon.utils.GlobalOjbectUtil;
import com.damon.utils.JsonChangeUtils;


@Service
public class WcsHttpService {
	public static Logger logger = LoggerFactory.getLogger(WcsHttpService.class);
	
	public String doProcedure(String url,String paramString) {
//		if("".equals(paramString)||paramString==null) {
//			logger.error("wms下发任务----参数为空！");
////			throw new CustomPromptException("参数为空！");
//		}
//		
//		try {
//			new JSONObject(paramString);
//		} catch (Exception e) {
//			logger.error("wms下发任务----json格式错误！");
////			throw new CustomPromptException("json格式错误！");
//		}
			//根据url查询存储过程名
			String procedureName = GlobalOjbectUtil.getProcedureMap().get(url);
			// 调用存储过程
			String result = ExecutorProcedureJdbc.doProceduce(procedureName, paramString);
				
			return result;
		}
		
	}

